package com.example.cloud.model.system;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

/**
 * Created by wangtao on 2018/1/26.
 */
@Entity(name = "sys_account")
@Data
@EqualsAndHashCode(callSuper = false)
public class Account extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 账户名称
    @Column(name = "account_name")
    private String accountName;
    // 管理员姓名
    @Column(name = "user_name")
    private String userName;
    // 管理员登录账号
    @Transient
    private String userLoginName;
    // 登录密码
    @Transient
    private String password;
    // 账户类型(0: 普通账户 1：管理员账户)
    @Column(name = "account_type",columnDefinition = "INT default 0")
    private int accountType;
    // 用户状态 {0：激活 1：冻结}
    @Column(name = "status", columnDefinition = "INT DEFAULT 0")
    private int status;
    // 账户所属组织机构
    @Column(name = "organ_id")
    private Long organId;
    // 账户所属组织名称
    @Column(name = "organ_name")
    private String organName;
}
